package com.jservice.api.service.smk;

import com.jservice.api.dto.Request;
import com.jservice.api.dto.Response;
import com.jservice.api.dto.ResponseHeader;
import com.jservice.api.service.BaseService;
import com.jservice.api.service.IService;
import com.jservice.api.smkAppUser.AppUserKit;
import com.jservice.model.SmkAppUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Smk0002 - 用户登出
 *
 * @Author cwledit
 * @DATE 2017/6/16.
 */
@Service("smk0002")
@Transactional
public class Smk0002 extends BaseService implements IService{

    @Override
    public Response excute(Request request, Response response, ResponseHeader header, String method) throws Exception {
        SmkAppUser smkAppUser = AppUserKit.getCurrent(request);
        if (smkAppUser != null){
           smkAppUser.setToken("");
           smkAppUser.update();
        }
        return renderSUC(true,response,header);
    }
}
